<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		
		window.onload = function(){

			var oBtn = document.getElementById('btn');
			
			oBtn.onclick = function(){
				var oDiv = document.getElementById('div1');
				oDiv.style.color = 'red';
				oDiv.style.fontSize = '30px';
			}

		}

	</script>
</head>
<body>	
	<div id="div1">这是一个div元素</div>
	<input type="button" name="" id="btn" value="改变div">
</body>
</html>